package logicaDePredicados;

public class Pair<S,T>{
	private S firstArgument;
	private T secondArgument;
	public Pair(S firstArgument, T secondArgument) {
		super();
		this.firstArgument = firstArgument;
		this.secondArgument = secondArgument;
	}
	/**
	 * @return the firstArgument
	 */
	public S getFirstArgument() {
		return firstArgument;
	}
	/**
	 * @param firstArgument the firstArgument to set
	 */
	public void setFirstArgument(S firstArgument) {
		this.firstArgument = firstArgument;
	}
	/**
	 * @return the secondArgument
	 */
	public T getSecondArgument() {
		return secondArgument;
	}
	/**
	 * @param secondArgument the secondArgument to set
	 */
	public void setSecondArgument(T secondArgument) {
		this.secondArgument = secondArgument;
	}
	public String toString (){
		return firstArgument+","+secondArgument;
	}
	
	@Override
	public boolean equals(Object o) { 
	
		if (o.getClass() == this.getClass()) { 
			Pair<?, ?> p1 = (Pair<?, ?>) o;
			return p1.getFirstArgument().equals(this.firstArgument)
			&& p1.getSecondArgument().equals(this.secondArgument);

		}

		return(false);
	}
	@Override
	public int hashCode() {
		int hash = 1;
	    hash = hash * 31 + firstArgument.hashCode();
	    hash = hash * 31 
	                + (secondArgument == null ? 0 : secondArgument.hashCode());
	    return hash;

		 
	}



}
